package com.merryituxz.o2o.util;

import java.io.File;

public class PathUtil {
    /*
        win: C:\Users\Administrator\Desktop
        linux:
     */
    public static String getImgBasePath() {
        String os = System.getProperty("os.name");
        String basePath = "";
        if (os.toLowerCase().startsWith("win")) {
            basePath = "C:/Users/Administrator/Desktop";
        } else {
            basePath = "/root/o2o_image";
        }
        return basePath;
    }

    /*
        shopId=1L
        linux: /upload/item/shop/1/
     */
    public static String getShopImgPath(long shopId) {
        String imagePath = "/upload/item/shop/" + shopId + "/";
        return imagePath;
    }

    public static String getHeadLineImagePath(){
        return "/upload/images/item/headtitle/";
    }

    public static String getShopCategoryPath() {
        return "/upload/images/item/shopcategory/";
    }

    public static void main(String[] args) {
        File file = new File("C:/Users/Administrator/Desktop/celeste");
        System.out.println(file.exists());
    }
}
